home comics writing pictures archive about

DialogViewModelBase.cs

Language: C#
Last Modified: 2020-06-27 1:58:36 PM UTC
File Size: 967 bytes
http://www.penguinstew.ca/example/MVVMbase/ViewModelBase/DialogViewModelBase.cs
using System;
namespace Penguin.MVVMBase.ViewModelBase
{
/// <summary>
/// Abstract base class for window viewModels.
/// </summary>
public class DialogViewModelBase: WindowViewModelBase, IDialogViewModel
{
#region IDialogViewModel
/// <summary>
/// Event raised to request the dialog be closed
/// </summary>
public event EventHandler<RequestDialogCloseArgs> DialogCloseRequested;
/// <summary>
/// Method to raise the DialogCloseRequested event
/// </summary>
/// <param name="result">The result to close the dialog with</param>
protected void RequestClose(bool result)
{
EventHandler<RequestDialogCloseArgs> handler = DialogCloseRequested;
if (handler != null)
{
handler(this, new RequestDialogCloseArgs(result));
}
}
#endregion
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32